import menus from '@/router/pages'
import router from '@/router'
const connectionroute=()=>{//动态添加子路由
   menus.forEach(item=>{
      router.addRoute('Index',item)
   });
   // 不匹配的路由放最后
   router.addRoute({
      path:'/:pathMatch(.*)+',
      redirect:"/404"
   })
}
connectionroute()